package com.yh.controller;

import com.yh.entity.ProductOrder;
import com.yh.service.IOrderService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yh.common.BaseResult;

import java.math.BigDecimal;

/**
 * @author yh
 */
@RestController
@RequestMapping("/api/order")
@AllArgsConstructor
public class OrderController {
    private final IOrderService orderService;

    @GetMapping("/genOrder")
    public BaseResult genOrder(Long proId, Long skuId,Integer nums ,BigDecimal money,Integer status){
        ProductOrder order = orderService.genOrder(proId,skuId,nums,money,status);
        return BaseResult.success(order);
    }
}
